﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace L09
{
    class Program
    {
        static void Main(string[] args)
        {

            Dictionary<string,string > dic1=new Dictionary<string, string> ();
            dic1.Add("中国", "China");
            dic1.Add("日本", "Japanese");
            dic1.Add("美国", "America");
            dic1.Add("英国", "England");
            dic1.Add("法国", "France");
            Console.Write("请输入一个中文单词：");
            string  num1 = Convert.ToString (Console.ReadLine());
            if (dic1 .ContainsKey(num1 ))
                Console.WriteLine("{0}的英文单词：{1}", num1, dic1 [num1]);
            Console.WriteLine();
            
            Dictionary<int, Tuple<String, String>> dic2 = new Dictionary<int, Tuple<string, string>>();
            Tuple<String, String> tuple1 = new Tuple<string, string>("赣州", "南京");
            dic2.Add(3137, tuple1);
            Tuple<String, String> tuple2 = new Tuple<string, string>("九江", "汉口");
            dic2.Add(252, tuple2);
            Console.Write("请输入一个车次：");
            int num2 = Convert.ToInt32(Console.ReadLine());
            if (dic2.ContainsKey(num2))
                Console.WriteLine("{0}车次的始发站和终点站是：{1}", num2, dic2[num2]);
            Console.WriteLine();

            Console.WriteLine("字典");
            foreach (KeyValuePair<string, string> kvp in dic1 )
            {
                Console.WriteLine("中文：{0},英文：{1}", kvp.Key, kvp.Value);
            }

            Console.WriteLine("列车");
            foreach (KeyValuePair<int, Tuple<string,string >> kvp in dic2)
            {
                Console.WriteLine("车次：{0},始发站和终点站：{1}", kvp.Key, kvp.Value);
            }


            Console.ReadKey();
        }
    }
}
